package com.yupi.ojbackend.judge;

import com.yupi.ojbackend.judge.strategy.DefaultJudgeStratege;
import com.yupi.ojbackend.judge.strategy.JavaJudgeStratege;
import com.yupi.ojbackend.judge.strategy.JudgeContext;
import com.yupi.ojbackend.judge.strategy.JudgeStratege;
import com.yupi.ojbackend.judge.codesandbox.model.JudgeInfo;

/**
 * 根据语言调用不同实现策略
 */
public class JudgeManager {
    public JudgeInfo doJudge(JudgeContext judgeContext,String language){
        JudgeStratege judgeStratege;
        if(language.equals("java")){
            judgeStratege=new JavaJudgeStratege();
            return judgeStratege.doJudge(judgeContext);
        }else{
            judgeStratege=new DefaultJudgeStratege();
            return judgeStratege.doJudge(judgeContext);
        }
    }
}
